import { storageSession } from "@pureadmin/utils";

import { type userRangeRegionsDataType } from "@/api/types";

export const userRegionsKey = "userRegionsKey";
export function setSessionUserRegions(data: userRangeRegionsDataType) {
  storageSession().setItem(userRegionsKey, data);
}

export function getSessionUserRegions(): userRangeRegionsDataType {
  return storageSession().getItem(userRegionsKey);
}

type mockDataType = "1" | "0";
export const userMockKey = "mock";
export function setSessionUserMock(data: mockDataType) {
  storageSession().setItem(userMockKey, data);
}

export function getSessionUserMock() {
  return storageSession().getItem(userMockKey) === "1" ? "1" : "0";
}
